package com.right.near.common.model.ao;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * 基础分页AO类
 *
 * @author: star
 * @date: 2022/7/19
 */
@Setter
@Getter
public class BasePageAO extends BaseAO {

    /**
     * 每页显示条数，默认 10
     */
    private long size = 10;

    /**
     * 当前页
     */
    private long current = 1;

    /**
     * 排序字段信息
     *
     * @ignore
     */
    protected List<OrderItem> orders = new ArrayList<>();

    /**
     * 生成page
     *
     * @return Page
     * @ignore
     */
    public <T> Page<T> createPage() {
        return new Page<>(this.current, this.size);
    }

}
